package org.easylookandfeel.adapter;

import javax.swing.UIManager;

import org.easylookandfeel.core.LookAndFeelManager;


/**
 * A adapter is responsible for linking Look and Feel plugin with application.
 * The {@link LookAndFeelManager} notifies registered adapters about Look and
 * Feel life cycle.
 * 
 * @author pcmnac@gmail.com
 * 
 */
public interface LookAndFeelAdapter {

	/**
	 * {@link LookAndFeelManager} call this method every time a
	 * {@link LookAndFeelAdapter} object is added to it. The
	 * {@link LookAndFeelAdapter} can store {@link LookAndFeelManager} reference
	 * to change Look and Feel according to its logic.
	 * 
	 * @param manager
	 *            The {@link LookAndFeelManager} where adapter was added.
	 */
	void setManager(LookAndFeelManager manager);

	/**
	 * {@link LookAndFeelManager} call this method during its initialization
	 * process.
	 * 
	 * @param looks
	 *            Available looks in the system.
	 */
	void initializeLookAndFeel(UIManager.LookAndFeelInfo[] looks);

	/**
	 * {@link LookAndFeelManager} calls this method every time application's
	 * look and feel is changed. The adapter should updates its state according
	 * to new look and feel.
	 * 
	 * @param lookAndFeelIndex
	 *            The new look and feel index.
	 */
	void handleLookAndFeelChanged(int lookAndFeelIndex);

}
